<template>
	<view class="main">
    <url-image src="/static/images/member/get-vip/1.jpg" mode="widthFix" class-name="img-box"/>
    <url-image src="/static/images/member/get-vip/2.jpg" mode="widthFix" class-name="img-box"/>
    <view class="sl-box">
      <url-image src="/static/images/member/get-vip/3.jpg" mode="widthFix" class-name="img-box"/>
      <view class="phone-box">
        <input type="number" maxlength="20" v-model="mobile" class="input" placeholder="请输入手机号码领取"/>
        <view class="btn-box">
          <view class="btn" @click="getCard">立即领取</view>
        </view>
      </view>
    </view>
    <url-image src="/static/images/member/get-vip/4.jpg" mode="widthFix" class-name="img-box"/>
    <url-image src="/static/images/member/get-vip/5.jpg" mode="widthFix" class-name="img-box"/>
    <c-global />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mobile:"",
			}
		},
    onLoad() {
    },
		methods: {
      getCard(){
        if(!this.mobile){
          this.$msg("请输入手机号");
          return;
        }
        this.$api.memberApi.getVipCard({
          mobile:this.mobile
        }).then(res=>{
          this.$gc.$message({
            content: '您已成功领取30张VIP卡，30分钟内到账',
            title: '温馨提示',
            type: 'richText',
            showMessage: true,
            showCancel: false,
            confirmText: '立即查看',
            align: 'center',
            confirm: async () => {
              this.$navigateTo('/pagesMine/myBuddy/myVip/index');
            }
          })
        })
      }
		}
	}
</script>

<style lang="scss" scoped>
.img-box{
  display: block;
  width: 100%;
}
.sl-box{
  position: relative;
  .phone-box{
    position: absolute;
    // width: 100%;
    top: 10rpx;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction:column;
    justify-content: center;
    padding: 0rpx 40rpx;
    .input{
      background: white;
      border-radius: 10rpx;
      padding: 12rpx 20rpx;
      text-align: center;
      width: 380rpx;
      line-height: 1.5;
      margin-bottom: 40rpx;
    }
    .input-placeholder{
      font-size: 28rpx;
    }
    .btn-box{
      display: flex;
      justify-content: center;
      .btn{
        color: white;
        display: inline-block;
        width: 250rpx;
        text-align: center;
        padding: 10rpx 0rpx;
        border-radius: 1000rpx;
        background: linear-gradient(180deg,rgb(193,144,75),rgb(217,179,132));
      }
    }
  }
}
</style>
